package com.ckv.qcm.model;

import com.ckv.qcm.model.dao.TrainerDAO;

public class Trainer extends User {

	private String mail;

	private static TrainerDAO dao = new TrainerDAO();

	public Trainer() {
		super();
	}

	public Trainer(long id, String name, String firstName, String mail,
			String password) {
		super(id, name, firstName, password);
		this.mail = mail;
		dao = new TrainerDAO();
	}

	public static Trainer find(long id) {
		return dao.find(id);
	}

	public Trainer authentify() throws Exception {
		return ((TrainerDAO) dao).authentify(this);
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	@Override
	public String toString() {
		return "Trainer [mail=" + mail + ", toString()=" + super.toString()
				+ "]";
	}

}
